package com.yunchao.bank.business.domain.enum

enum class BusinessType(val code: Int, val taskName: String) {

    // 空包装箱登记任务
    EMPTY_CONTAINER_REGISTRATION_ISSUE(0x00020001, "空包登记"),
    EMPTY_CONTAINER_REGISTRATION_SUBMIT(0x00028001, "空包登记"),

    // 出库任务
    OUTBOUND_TASK_ISSUE(0x00020002, "出库"),
    OUTBOUND_TASK_SUBMIT(0x00028002, "出库"),

    // 入库任务
    INBOUND_TASK_ISSUE(0x00020003, "入库"),
    INBOUND_TASK_SUBMIT(0x00028003, "入库"),

    // 实物交接任务
    PHYSICAL_HANDOVER_ISSUE(0x00020004, "实物交接"),
    PHYSICAL_HANDOVER_SUBMIT(0x00028004, "实物交接"),

    // 款项分配任务
    FUND_ALLOCATION_ISSUE(0x00020005, "款项分配"),
    FUND_ALLOCATION_SUBMIT(0x00028005, "款项分配"),

    // 电子签封核对
    E_SEAL_VERIFICATION_ISSUE(0x00020006,  "电子签封核对"),
    E_SEAL_VERIFICATION_SUBMIT(0x00028006,  "电子签封核对"),

    // 非业务进出库
    NON_BUSINESS_IN_OUT_ISSUE(0x00020007,  "非业务进出库"),
    NON_BUSINESS_IN_OUT_SUBMIT(0x00028007,  "非业务进出库"),

    // 空电子签封入库
    EMPTY_E_SEAL_STORAGE_ISSUE(0x00020008,  "空电子签封入库"),
    EMPTY_E_SEAL_STORAGE_SUBMIT(0x00028008,  "空电子签封入库"),

    // 电子签封入库核对
    E_SEAL_STORAGE_VERIFICATION_ISSUE(0x00020009, "入库核对"),
    E_SEAL_STORAGE_VERIFICATION_SUBMIT(0x00028009, "入库核对"),

    // 封箱扫描任务
    BOX_SEALING_SCAN_ISSUE(0x00010001, "封箱扫描"),
    BOX_SEALING_SCAN_SUBMIT(0x00018001, "封箱扫描"),

    // 拆封扫描任务
    UNPACKING_SCAN_ISSUE(0x00010002, "拆封扫描"),
    UNPACKING_SCAN_SUBMIT(0x00018002, "拆封扫描");

    companion object {
        private val codeToTaskName = BusinessType.entries.associate { it.code to it.taskName }

        fun getTaskNameByCode(code: Int): String? {
            return codeToTaskName[code]
        }
    }
}